##############################################################################
#
# NetTool.tcl
# ===========
#
# Author: Steven Liang <stliang@gmail.com>
#
# Purpose:
#   Base class for all types of network test tools
#
# Assumptions:
#   1.) A network test tool has an IP address
#   2.) There is some what to connect to it
#
# Supported methods:
#   constructor {IP {port 23}}
#   destructor
#   getIP {}
#   getPort {}
#
##############################################################################

itcl::class Node {
	protected variable _ip
	protected variable _port

	# Method:      constructor
	# Purpose:     Instantiate a Node object
	# Parameters:
	#       1.) ip : IP address of the node
	#       2.) userName : User name used for login
	#       3.) passWord : Password used for login
	#       4.) port : A port to use for telnet, default value is 23
	constructor {ip {port 23}} {
		set _ip $ip
		set _port $port
	}

	# Method:     destructor
	# Purpose:    Release resource
	# Parameters: None
	# Returns:    Void
	destructor {
	}

	# Method:     getIP
	# Purpose:    Read only IP address of instance Node
	# Parameters: None
	# Returns:    IP address of instance Node
	method getIP {} {
    		return $_ip
	}

	# Method:     getPort
	# Purpose:    Read only port of instance Node
	# Parameters: None
	# Returns:    Port of instance Node
	method getPort {} {
	    	return $_port
	}
}
